const {http} = require("../../utils/http")
Page({
 data:{
     musics:[]
 },
 onLoad(){
     var url = 'http://47.108.197.28:3000/top/playlist?cat=华语'
     /* 1、发送http请求 */
     http({
        url,
        success:res=>{
            var musics = []
            var playlists = res.data.playlists;
            playlists.forEach(item=>{
                var {id,name,coverImgUrl} = item;
                musics.push({
                    id,
                    name,
                    coverImgUrl
                })
            })
            this.setData({
                musics
            })
        }
     })
 }
})
